<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    'use strict'
    // num = 10
    // console.log(10);

    function show() {
      console.log('1');
      console.log(this);//严格模式下 undefined
    }
    show()
    setTimeout(function () {
      console.log(2);
      console.log(this);
    }, 500)
    setInterval(function () {
      console.log(this);
    }, 1000)
    function People(name) {
      this.name = name
      this.say = function () {
        console.log('吃饭');
        console.log(this);
      }
    }
    var p = new People('小米')
    p.say()
  </script>
</body>

</html>